package com.ysd.resourceusestatistics.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.hibernate.annotations.CreationTimestamp;

import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;

/**
 * Member
 */
@Data
@Entity
@Table
public class Member {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)//自增
    private Integer id;// id编号
    @Column(unique = true)
    private String cardNo;// 会员卡号
    @NotBlank(message = "姓名不能为空")
    private String name;// 姓名
    @Excel(name = "性别",replace ={"男","女"})
    private String sex;// 性别
    @Excel(name = "教师_teacher,学生_student", orderNum = "1", isImportField = "true_teacher,true_student")
    private String category;// 身份
    @Column(length = 18,unique = true)
   @Excel(name = "身份证号码")
  /*  @Pattern(regexp = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|"

   + "(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)") */
    private String card; // 身份证号,唯一，不为空
    private String department;// 系别
    private String profession;// 专业
    private String grade;// 年级

@Excel(name = "手机号")
/* @Pattern(regexp = "13[0-9], 14[5,6,7,8,9], 15[0-3, 5-9], 16[2,5,6,7], 17[0-8], 18[0-9], 19[0-3, 5-9]")
 */    private String phone;// 电话
    @CreationTimestamp//自动生成时间
    @Excel(name = "入会时间", databaseFormat = "yyyyMMddHHmmss", format = "yyyy-MM-dd HH:mm:ss")
    private Date regdate;// 入会时间
    @Column(insertable = false,columnDefinition = "int default 0")
private Integer status;//使用状态0否1是
private String remark;//备注
    
}